const BASE_URL = 'https://lqcheng.cn:8985/schoolnews'
// const BASE_URL = 'http://192.168.3.183:8985/schoolnews'
export const myRequest = (options) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url:BASE_URL + options.url,
			method: options.method || 'GET',
			header: {
				"Content-Type": "application/x-www-form-urlencoded",
				"token": options.token || ""
			},
			data: options.data || {},
			success: (res) => {
				if(!res.data) {
					return uni.showToast({
						title: '获取数据失败'
					})
				}
				resolve(res)
			},
			fail: (err) => {
				uni.showToast({
					title: '接口请求失败'
				})
				reject(err)
			}
		})
	})
}